<?php
namespace Index\Controller;
use Think\Controller;
class PublishController extends Controller {
    public function ueditor(){
        $data = new \Org\Util\Ueditor($_SERVER['id']);
        echo $data->output();
    }
    public function index(){
        if (!empty($_SESSION['id'])) {
            if (IS_POST) {
                var_dump($_POST);
                $m = M();
                $text = I("post.text");
                $content = I('post.content','',false);
                var_dump($content);
                $sjc = time();
                $sql = "insert into `wenti` (text,content,sid,tim) values('{$text}','{$content}',{$_SESSION['id']},{$sjc})";
                if($m->execute($sql)){
                    $this->error("提交成功");
                };
            } else {
                var_dump($_SESSION);
                $this->display("index");
            }
        }else{
            $this->display("index");
        }
    }
}